package day6;

public class Demo1 {

    static class Person{
        public void sayHello() {}
    }

    static class American extends Person{

        public void sayHello() {
            System.out.println("Hello");
        }
    }

    static class Chinese extends Person{

        @Override
        public void sayHello() {
            System.out.println("您好");
        }
    }

    static class Thailand extends Person{
        @Override
        public void sayHello() {
            System.out.println("หวัดดี");
        }
    }

    static class Japanese extends Person{
        @Override
        public void sayHello() {
            System.out.println("こんにちは");
        }
    }

    public static void main(String[] args) {
        Person american = new American();
        Person chinese = new Chinese();
        Person thailand = new Thailand();
        Person japanese = new Japanese();

        american.sayHello();
        chinese.sayHello();
        thailand.sayHello();
        japanese.sayHello();
    }
}
